package example.io;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class PrinterThread extends Thread {

	
	@Override
	public void run() {
		print();
	}

	public void print() {
		try {

			File file = new File("d:/vijay.txt");

			FileWriter fw = new FileWriter(file, false);
			PrintWriter pw = new PrintWriter(fw);
			pw.println("Hello Android");
			try {
				sleep(1000);
			} catch (InterruptedException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			pw.flush();
			pw.close();
		} catch(IOException e) {

		}
	}
	
	
	public static void main(String args[]) {
		PrinterThread hpPrinter = new PrinterThread();
		hpPrinter.start();
	}
}
